#pragma once
#include <iostream>
#include <vector>
#include <any>
#include <windows.h>
#include <comdef.h>
#include <atlbase.h>
#include <atlsafe.h>

#define Array std::vector<std::any>

class AnsysEDCOM {
public:
    AnsysEDCOM(const wchar_t* ProgID);
    ~AnsysEDCOM();
    IDispatch* InvokeMethod(IDispatch* pDispatch, OLECHAR* methodName, std::vector<std::any> params_vector);
    IDispatch* getAppDesktop();
private:
    SAFEARRAY* parsingParams(std::vector<std::any > Params_);
private:
    HRESULT hr;
    CLSID clsid;
    IUnknown* pUnknown = NULL;
    IDispatch* AppDesktop = NULL;
    DISPID dispid;
    VARIANT result;
};

